# 公共类的定义

# 字段类
class Field:
    def __init__(self, service, operation, field, value: str = ''):
        self.service = service  # 服务名
        self.operation = operation  # 操作名
        self.field = field  # 字段名，扁平化之后
        if value:
            self.value = value
        self.type = None  # 类型推断，之后再做

    def __str__(self):
        return f'({self.service}, {self.operation}, {self.field})'

    def __hash__(self):
        return hash((self.service, self.operation, self.field))
